#include<stdio.h>
#define r 3
#define c 3
main()
{
    int a[r][c],b[r][c],k[r][c];
    int i,j,s;    
    printf("enter the fist matrix(%dx%d) row-wise: \n",r,c);
    for(i=0;i<r;i++)
        for(j=0;j<c;j++)
        scanf("%d",&a[i][j]);
        
    printf("The matrix u have entered: \n");
    for(i=0;i<r;i++)
    {
        for(j=0;j<c;j++)
        printf("%3d",a[i][j]);
        printf("\n");
     }          
   printf("enter the second  matrix(%dx%d) row-wise: \n",r,c);
    for(i=0;i<r;i++)
        for(j=0;j<c;j++)
        scanf("%d",&b[i][j]);
        
    printf("The matrix u have entered: \n");
    for(i=0;i<r;i++)
    {
        for(j=0;j<c;j++)
        printf("%3d ",b[i][j]);
        printf("\n");
    } 
     //multiplication   
     for(i=0;i<r;i++)
        for(j=0;j<c;j++)
        {
            k[i][j]=0;
            for(s=0;s<r;s++)
            {
                k[i][j]+=a[i][s]*b[s][j];
            }
        }
        printf("the result is :\n");
    
     for(i=0;i<r;i++)
     {
        for(j=0;j<c;j++)
        printf("%3d",k[i][j]); 
        printf("\n");
     }   
 }
